Repository navigation
Make isValidEmail callable from commonMain - #3368
Closed
StylianosGakis wants to merge 1 commit into
Closed
StylianosGakis wants to merge 1 commit into
StylianosGakis wants to merge 1 commit into
Conversation
isValidEmail becomes an expect in commonMain of :core-common-public. The Android actual keeps its PatternsCompat body. The JVM and native actuals full-match a Regex built from the PatternsCompat.EMAIL_ADDRESS pattern string, copied from androidx.core 1.19.1 sources and held once in commonMain. The new commonTest runs on JVM and the iOS simulator.
This was referenced Nov 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤖 AI description
Makes
isValidEmailcallable fromcommonMainincore-common-public. Three features validate emails in presenter code that is about to move tocommonMain(insurance certificate, travel certificate, login), and the only validator was Android-only because it usesPatternsCompat.On Android nothing changes: the existing function just gains the
actualkeyword. JVM and iOS match against the same pattern string, copied verbatim fromPatternsCompat.EMAIL_ADDRESSin androidx.core 1.19.1, so every target accepts exactly the same addresses. The test runs the same cases on the JVM and on the iOS simulator, since Kotlin/Native has its own regex engine.No caller changes here.